package com.derbysoft.dswitch.adapter.ihg.common.repository.impl;

import com.derbysoft.dswitch.adapter.ihg.common.domain.ReservationModifyItem;
import com.derbysoft.dswitch.adapter.ihg.common.repository.ResModifyItemRepository;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("resModifyItemRepository")
public class ResModifyItemRepositoryImpl
        extends CommonService<ReservationModifyItem> implements ResModifyItemRepository {
    private static final String ERSP = "ersp";

    @Override
    public List<ReservationModifyItem> loadByErsp(String ersp) {
        DetachedCriteria criteria = DetachedCriteria.forClass(ReservationModifyItem.class);
        criteria.add(Restrictions.eq(ERSP, ersp));
        return find(criteria);
    }
}